{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 国内主要城市年度数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: pyecharts in c:\\users\\76451\\anaconda\\lib\\site-packages (1.9.1)\n",
      "Requirement already satisfied: jinja2 in c:\\users\\76451\\anaconda\\lib\\site-packages (from pyecharts) (2.11.2)\n",
      "Requirement already satisfied: prettytable in c:\\users\\76451\\anaconda\\lib\\site-packages (from pyecharts) (3.3.0)\n",
      "Requirement already satisfied: simplejson in c:\\users\\76451\\anaconda\\lib\\site-packages (from pyecharts) (3.17.6)\n",
      "Requirement already satisfied: MarkupSafe>=0.23 in c:\\users\\76451\\anaconda\\lib\\site-packages (from jinja2->pyecharts) (1.1.1)\n",
      "Requirement already satisfied: wcwidth in c:\\users\\76451\\anaconda\\lib\\site-packages (from prettytable->pyecharts) (0.2.5)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: You are using pip version 21.1.1; however, version 22.1.2 is available.\n",
      "You should consider upgrading via the 'c:\\users\\76451\\anaconda\\python.exe -m pip install --upgrade pip' command.\n"
     ]
    }
   ],
   "source": [
    "!pip install pyecharts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模块准备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Map, EffectScatter, HeatMap, Line,Grid,Geo\n",
    "from pyecharts.faker import Faker\n",
    "from pyecharts.globals import SymbolType\n",
    "from pyecharts.charts import Pie,Bar,Pie,WordCloud\n",
    "import random\n",
    "from calendar import c\n",
    "from tkinter import Grid\n",
    "from pyecharts.commons.utils import JsCode\n",
    "import re\n",
    "import collections\n",
    "import jieba\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.components import Table\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.globals import ChartType\n",
    "import textwrap"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入数据（数据已清理）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>年份</th>\n",
       "      <th>在岗职工平均工资</th>\n",
       "      <th>总人口</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>2017</td>\n",
       "      <td>134994</td>\n",
       "      <td>1382</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天津</td>\n",
       "      <td>2017</td>\n",
       "      <td>96965</td>\n",
       "      <td>1001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>江西</td>\n",
       "      <td>2017</td>\n",
       "      <td>67880</td>\n",
       "      <td>6744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>西藏</td>\n",
       "      <td>2017</td>\n",
       "      <td>72114</td>\n",
       "      <td>3297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>2017</td>\n",
       "      <td>63084</td>\n",
       "      <td>2376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>江苏</td>\n",
       "      <td>2017</td>\n",
       "      <td>74181</td>\n",
       "      <td>4238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>安徽</td>\n",
       "      <td>2017</td>\n",
       "      <td>81884</td>\n",
       "      <td>2728</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>长春</td>\n",
       "      <td>2017</td>\n",
       "      <td>73469</td>\n",
       "      <td>3689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>辽宁</td>\n",
       "      <td>2017</td>\n",
       "      <td>67542</td>\n",
       "      <td>1674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>上海</td>\n",
       "      <td>2017</td>\n",
       "      <td>130765</td>\n",
       "      <td>7438</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>河北</td>\n",
       "      <td>2017</td>\n",
       "      <td>101502</td>\n",
       "      <td>4677</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>浙江</td>\n",
       "      <td>2017</td>\n",
       "      <td>96670</td>\n",
       "      <td>5986</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>青海</td>\n",
       "      <td>2017</td>\n",
       "      <td>91705</td>\n",
       "      <td>3471</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>湖北</td>\n",
       "      <td>2017</td>\n",
       "      <td>77484</td>\n",
       "      <td>4140</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>福州</td>\n",
       "      <td>2017</td>\n",
       "      <td>75133</td>\n",
       "      <td>9079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>宁夏</td>\n",
       "      <td>2017</td>\n",
       "      <td>75452</td>\n",
       "      <td>9256</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>河南</td>\n",
       "      <td>2017</td>\n",
       "      <td>72686</td>\n",
       "      <td>6028</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>山西</td>\n",
       "      <td>2017</td>\n",
       "      <td>84645</td>\n",
       "      <td>6440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>陕西</td>\n",
       "      <td>2017</td>\n",
       "      <td>83539</td>\n",
       "      <td>8642</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>郑州</td>\n",
       "      <td>2017</td>\n",
       "      <td>70486</td>\n",
       "      <td>4489</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>武汉</td>\n",
       "      <td>2017</td>\n",
       "      <td>79684</td>\n",
       "      <td>787</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>湖南</td>\n",
       "      <td>2017</td>\n",
       "      <td>85187</td>\n",
       "      <td>3090</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>广东</td>\n",
       "      <td>2017</td>\n",
       "      <td>98612</td>\n",
       "      <td>8329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>山东</td>\n",
       "      <td>2017</td>\n",
       "      <td>100173</td>\n",
       "      <td>3525</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>广西</td>\n",
       "      <td>2017</td>\n",
       "      <td>75481</td>\n",
       "      <td>4288</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>海南</td>\n",
       "      <td>2017</td>\n",
       "      <td>68037</td>\n",
       "      <td>262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>重庆</td>\n",
       "      <td>2017</td>\n",
       "      <td>73272</td>\n",
       "      <td>3605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>四川</td>\n",
       "      <td>2017</td>\n",
       "      <td>79292</td>\n",
       "      <td>2562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>贵州</td>\n",
       "      <td>2017</td>\n",
       "      <td>73939</td>\n",
       "      <td>518</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>云南</td>\n",
       "      <td>2017</td>\n",
       "      <td>76350</td>\n",
       "      <td>562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>2017</td>\n",
       "      <td>111092</td>\n",
       "      <td>1925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>甘肃</td>\n",
       "      <td>2017</td>\n",
       "      <td>77774</td>\n",
       "      <td>5643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>兰州</td>\n",
       "      <td>2017</td>\n",
       "      <td>75709</td>\n",
       "      <td>3452</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>吉林</td>\n",
       "      <td>2017</td>\n",
       "      <td>73540</td>\n",
       "      <td>6578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>福建</td>\n",
       "      <td>2017</td>\n",
       "      <td>77206</td>\n",
       "      <td>2325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>新疆</td>\n",
       "      <td>2017</td>\n",
       "      <td>78072</td>\n",
       "      <td>3432</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     地区    年份  在岗职工平均工资   总人口\n",
       "0    北京  2017    134994  1382\n",
       "1    天津  2017     96965  1001\n",
       "2    江西  2017     67880  6744\n",
       "3    西藏  2017     72114  3297\n",
       "4   黑龙江  2017     63084  2376\n",
       "5    江苏  2017     74181  4238\n",
       "6    安徽  2017     81884  2728\n",
       "7    长春  2017     73469  3689\n",
       "8    辽宁  2017     67542  1674\n",
       "9    上海  2017    130765  7438\n",
       "10   河北  2017    101502  4677\n",
       "11   浙江  2017     96670  5986\n",
       "12   青海  2017     91705  3471\n",
       "13   湖北  2017     77484  4140\n",
       "14   福州  2017     75133  9079\n",
       "15   宁夏  2017     75452  9256\n",
       "16   河南  2017     72686  6028\n",
       "17   山西  2017     84645  6440\n",
       "18   陕西  2017     83539  8642\n",
       "19   郑州  2017     70486  4489\n",
       "20   武汉  2017     79684   787\n",
       "21   湖南  2017     85187  3090\n",
       "22   广东  2017     98612  8329\n",
       "23   山东  2017    100173  3525\n",
       "24   广西  2017     75481  4288\n",
       "25   海南  2017     68037   262\n",
       "26   重庆  2017     73272  3605\n",
       "27   四川  2017     79292  2562\n",
       "28   贵州  2017     73939   518\n",
       "29   云南  2017     76350   562\n",
       "30  内蒙古  2017    111092  1925\n",
       "31   甘肃  2017     77774  5643\n",
       "32   兰州  2017     75709  3452\n",
       "33   吉林  2017     73540  6578\n",
       "34   福建  2017     77206  2325\n",
       "35   新疆  2017     78072  3432"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('data-1.csv')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 全国各地区在岗职员平均工资——地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c529f5fd6e394a5fbfb08c6b1a3fabe0\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_c529f5fd6e394a5fbfb08c6b1a3fabe0 = echarts.init(\n",
       "                    document.getElementById('c529f5fd6e394a5fbfb08c6b1a3fabe0'), 'white', {renderer: 'canvas'});\n",
       "                var option_c529f5fd6e394a5fbfb08c6b1a3fabe0 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u5404\\u5730\\u533a\\u5728\\u5c97\\u804c\\u5458\\u5e73\\u5747\\u5de5\\u8d44\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 134994\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 96965\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 67880\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u85cf\",\n",
       "                    \"value\": 72114\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 63084\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 74181\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 81884\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u957f\\u6625\",\n",
       "                    \"value\": 73469\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 67542\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 130765\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 101502\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 96670\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u6d77\",\n",
       "                    \"value\": 91705\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 77484\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5dde\",\n",
       "                    \"value\": 75133\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u590f\",\n",
       "                    \"value\": 75452\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 72686\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 84645\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 83539\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u90d1\\u5dde\",\n",
       "                    \"value\": 70486\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6b66\\u6c49\",\n",
       "                    \"value\": 79684\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 85187\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 98612\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 100173\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 75481\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 68037\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 73272\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 79292\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 73939\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e91\\u5357\",\n",
       "                    \"value\": 76350\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 111092\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 77774\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5170\\u5dde\",\n",
       "                    \"value\": 75709\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 73540\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 77206\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u7586\",\n",
       "                    \"value\": 78072\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5404\\u5730\\u533a\\u5728\\u5c97\\u804c\\u5458\\u5e73\\u5747\\u5de5\\u8d44\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5404\\u5730\\u533a\\u5728\\u5c97\\u804c\\u5458\\u5e73\\u5747\\u5de5\\u8d44\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5728\\u5c97\\u804c\\u5458\\u5e73\\u5747\\u5de5\\u8d44\",\n",
       "            \"subtext\": \"2017\\u5e74\\u5168\\u56fd\\u4e3b\\u8981\\u5730\\u533a\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 63084,\n",
       "        \"max\": 134994,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_c529f5fd6e394a5fbfb08c6b1a3fabe0.setOption(option_c529f5fd6e394a5fbfb08c6b1a3fabe0);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x214b855d790>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " a = (\n",
    "        Map()\n",
    "            .add(\"各地区在岗职员平均工资\", list(zip(df.地区, df.在岗职工平均工资)), \"china\")\n",
    "            .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"在岗职员平均工资\",subtitle=\"2017年全国主要地区\"),\n",
    "            visualmap_opts=opts.VisualMapOpts(min_=63084, max_=134994),\n",
    "        )\n",
    "    )\n",
    "a.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 各地区城乡人口分布情况——地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"ab5895d88d99484cace29e79d2f4fbfe\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_ab5895d88d99484cace29e79d2f4fbfe = echarts.init(\n",
       "                    document.getElementById('ab5895d88d99484cace29e79d2f4fbfe'), 'white', {renderer: 'canvas'});\n",
       "                var option_ab5895d88d99484cace29e79d2f4fbfe = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u5404\\u5730\\u533a\\u57ce\\u4e61\\u603b\\u4eba\\u53e3\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": 1382\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5929\\u6d25\",\n",
       "                    \"value\": 1001\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": 6744\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u897f\\u85cf\",\n",
       "                    \"value\": 3297\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9ed1\\u9f99\\u6c5f\",\n",
       "                    \"value\": 2376\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": 4238\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": 2728\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u957f\\u6625\",\n",
       "                    \"value\": 3689\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8fbd\\u5b81\",\n",
       "                    \"value\": 1674\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": 7438\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": 4677\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": 5986\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9752\\u6d77\",\n",
       "                    \"value\": 3471\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": 4140\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5dde\",\n",
       "                    \"value\": 9079\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b81\\u590f\",\n",
       "                    \"value\": 9256\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": 6028\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": 6440\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9655\\u897f\",\n",
       "                    \"value\": 8642\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u90d1\\u5dde\",\n",
       "                    \"value\": 4489\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6b66\\u6c49\",\n",
       "                    \"value\": 787\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": 3090\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": 8329\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": 3525\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"value\": 4288\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d77\\u5357\",\n",
       "                    \"value\": 262\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": 3605\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": 2562\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8d35\\u5dde\",\n",
       "                    \"value\": 518\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e91\\u5357\",\n",
       "                    \"value\": 562\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5185\\u8499\\u53e4\",\n",
       "                    \"value\": 1925\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7518\\u8083\",\n",
       "                    \"value\": 5643\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5170\\u5dde\",\n",
       "                    \"value\": 3452\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u6797\",\n",
       "                    \"value\": 6578\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u798f\\u5efa\",\n",
       "                    \"value\": 2325\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u7586\",\n",
       "                    \"value\": 3432\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5404\\u5730\\u533a\\u57ce\\u4e61\\u603b\\u4eba\\u53e3\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5404\\u5730\\u533a\\u57ce\\u4e61\\u603b\\u4eba\\u53e3\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u57ce\\u4e61\\u4eba\\u53e3\\u5206\\u5e03\\u5206\\u6790\",\n",
       "            \"subtext\": \"\\u5404\\u5730\\u533a\\u603b\\u4eba\\u53e3\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 262,\n",
       "        \"max\": 9256,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_ab5895d88d99484cace29e79d2f4fbfe.setOption(option_ab5895d88d99484cace29e79d2f4fbfe);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x194b36f42e0>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = (\n",
    "        Map()\n",
    "            .add(\"各地区城乡总人口\", list(zip(df.地区, df.总人口)), \"china\")\n",
    "            .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"城乡人口分布分析\",subtitle=\"各地区总人口\"),\n",
    "            visualmap_opts=opts.VisualMapOpts(min_=262, max_=9256,is_piecewise=True),\n",
    "        )\n",
    "    )\n",
    "a.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 各地区城镇、乡村人口比例——饼图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 导入另一个数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>城镇人口比例</th>\n",
       "      <th>乡村人口比例</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北  京</td>\n",
       "      <td>77.54</td>\n",
       "      <td>22.46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天  津</td>\n",
       "      <td>71.99</td>\n",
       "      <td>28.01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>河  北</td>\n",
       "      <td>26.08</td>\n",
       "      <td>73.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>山  西</td>\n",
       "      <td>34.91</td>\n",
       "      <td>65.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>42.68</td>\n",
       "      <td>57.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>辽  宁</td>\n",
       "      <td>54.24</td>\n",
       "      <td>45.76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>吉  林</td>\n",
       "      <td>49.68</td>\n",
       "      <td>50.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>51.54</td>\n",
       "      <td>48.46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>上  海</td>\n",
       "      <td>88.31</td>\n",
       "      <td>11.69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>江  苏</td>\n",
       "      <td>41.49</td>\n",
       "      <td>58.51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>浙  江</td>\n",
       "      <td>48.67</td>\n",
       "      <td>51.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>安  徽</td>\n",
       "      <td>27.81</td>\n",
       "      <td>72.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>福  建</td>\n",
       "      <td>41.57</td>\n",
       "      <td>58.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>江  西</td>\n",
       "      <td>27.67</td>\n",
       "      <td>72.33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>山  东</td>\n",
       "      <td>38.00</td>\n",
       "      <td>62.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>河  南</td>\n",
       "      <td>23.20</td>\n",
       "      <td>76.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>湖  北</td>\n",
       "      <td>40.22</td>\n",
       "      <td>59.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>湖  南</td>\n",
       "      <td>29.75</td>\n",
       "      <td>70.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>广  东</td>\n",
       "      <td>55.00</td>\n",
       "      <td>45.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>广  西</td>\n",
       "      <td>28.15</td>\n",
       "      <td>71.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>海  南</td>\n",
       "      <td>40.11</td>\n",
       "      <td>59.89</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>重  庆</td>\n",
       "      <td>33.09</td>\n",
       "      <td>66.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>四  川</td>\n",
       "      <td>26.69</td>\n",
       "      <td>73.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>贵  州</td>\n",
       "      <td>23.87</td>\n",
       "      <td>76.13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>云  南</td>\n",
       "      <td>23.36</td>\n",
       "      <td>76.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>西  藏</td>\n",
       "      <td>18.93</td>\n",
       "      <td>81.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>陕  西</td>\n",
       "      <td>32.26</td>\n",
       "      <td>67.74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>甘  肃</td>\n",
       "      <td>24.01</td>\n",
       "      <td>75.99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>青  海</td>\n",
       "      <td>34.76</td>\n",
       "      <td>65.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>宁  夏</td>\n",
       "      <td>32.43</td>\n",
       "      <td>67.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>新  疆</td>\n",
       "      <td>33.82</td>\n",
       "      <td>66.18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        地区  城镇人口比例  乡村人口比例\n",
       "0    北  京    77.54   22.46\n",
       "1    天  津    71.99   28.01\n",
       "2    河  北    26.08   73.92\n",
       "3    山  西    34.91   65.09\n",
       "4     内蒙古    42.68   57.32\n",
       "5    辽  宁    54.24   45.76\n",
       "6    吉  林    49.68   50.32\n",
       "7     黑龙江    51.54   48.46\n",
       "8    上  海    88.31   11.69\n",
       "9    江  苏    41.49   58.51\n",
       "10   浙  江    48.67   51.33\n",
       "11   安  徽    27.81   72.19\n",
       "12   福  建    41.57   58.43\n",
       "13   江  西    27.67   72.33\n",
       "14   山  东    38.00   62.00\n",
       "15   河  南    23.20   76.80\n",
       "16   湖  北    40.22   59.78\n",
       "17   湖  南    29.75   70.25\n",
       "18   广  东    55.00   45.00\n",
       "19   广  西    28.15   71.85\n",
       "20   海  南    40.11   59.89\n",
       "21   重  庆    33.09   66.91\n",
       "22   四  川    26.69   73.31\n",
       "23   贵  州    23.87   76.13\n",
       "24   云  南    23.36   76.64\n",
       "25   西  藏    18.93   81.07\n",
       "26   陕  西    32.26   67.74\n",
       "27   甘  肃    24.01   75.99\n",
       "28   青  海    34.76   65.24\n",
       "29   宁  夏    32.43   67.57\n",
       "30   新  疆    33.82   66.18"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = pd.read_csv('data2.csv', encoding='utf8')\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 各地区城镇人口比例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"7ae4c62a112b4946bbc96b3e8e8001b0\" style=\"width:800px; height:400px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_7ae4c62a112b4946bbc96b3e8e8001b0 = echarts.init(\n",
       "                    document.getElementById('7ae4c62a112b4946bbc96b3e8e8001b0'), 'white', {renderer: 'canvas'});\n",
       "                var option_7ae4c62a112b4946bbc96b3e8e8001b0 = {\n",
       "    \"backgroundColor\": \"#641F37\",\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u57ce\\u9547\\u4eba\\u53e3\\u6bd4\\u4f8b\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u897f\\u00a0\\u00a0\\u85cf\\u00a0\",\n",
       "                    \"value\": 18.93\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 23.2\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u4e91\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 23.36\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u8d35\\u00a0\\u00a0\\u5dde\\u00a0\",\n",
       "                    \"value\": 23.87\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u7518\\u00a0\\u00a0\\u8083\\u00a0\",\n",
       "                    \"value\": 24.01\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                    \"value\": 26.08\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u56db\\u00a0\\u00a0\\u5ddd\\u00a0\",\n",
       "                    \"value\": 26.69\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 27.67\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5b89\\u00a0\\u00a0\\u5fbd\\u00a0\",\n",
       "                    \"value\": 27.81\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 28.15\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 29.75\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u9655\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 32.26\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5b81\\u00a0\\u00a0\\u590f\\u00a0\",\n",
       "                    \"value\": 32.43\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u91cd\\u00a0\\u00a0\\u5e86\\u00a0\",\n",
       "                    \"value\": 33.09\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u65b0\\u00a0\\u00a0\\u7586\\u00a0\",\n",
       "                    \"value\": 33.82\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u9752\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                    \"value\": 34.76\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5c71\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 34.91\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5c71\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                    \"value\": 38.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6d77\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 40.11\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                    \"value\": 40.22\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u82cf\\u00a0\",\n",
       "                    \"value\": 41.49\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u798f\\u00a0\\u00a0\\u5efa\\u00a0\",\n",
       "                    \"value\": 41.57\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5185\\u8499\\u53e4\\u00a0\",\n",
       "                    \"value\": 42.68\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6d59\\u00a0\\u00a0\\u6c5f\\u00a0\",\n",
       "                    \"value\": 48.67\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5409\\u00a0\\u00a0\\u6797\\u00a0\",\n",
       "                    \"value\": 49.68\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u9ed1\\u9f99\\u6c5f\\u00a0\",\n",
       "                    \"value\": 51.54\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u8fbd\\u00a0\\u00a0\\u5b81\\u00a0\",\n",
       "                    \"value\": 54.24\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                    \"value\": 55.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5929\\u00a0\\u00a0\\u6d25\\u00a0\",\n",
       "                    \"value\": 71.99\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5317\\u00a0\\u00a0\\u4eac\\u00a0\",\n",
       "                    \"value\": 77.54\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u4e0a\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                    \"value\": 88.31\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": \"55%\",\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"color\": \"rgba(255, 255, 255, 0.3)\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": \"{a} <br/>{b}: {c} ({d}%)\",\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u00a0\\u897f\\u00a0\\u00a0\\u85cf\\u00a0\",\n",
       "                \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u4e91\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u8d35\\u00a0\\u00a0\\u5dde\\u00a0\",\n",
       "                \"\\u00a0\\u7518\\u00a0\\u00a0\\u8083\\u00a0\",\n",
       "                \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                \"\\u00a0\\u56db\\u00a0\\u00a0\\u5ddd\\u00a0\",\n",
       "                \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u5b89\\u00a0\\u00a0\\u5fbd\\u00a0\",\n",
       "                \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u9655\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u5b81\\u00a0\\u00a0\\u590f\\u00a0\",\n",
       "                \"\\u00a0\\u91cd\\u00a0\\u00a0\\u5e86\\u00a0\",\n",
       "                \"\\u00a0\\u65b0\\u00a0\\u00a0\\u7586\\u00a0\",\n",
       "                \"\\u00a0\\u9752\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                \"\\u00a0\\u5c71\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u5c71\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                \"\\u00a0\\u6d77\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u82cf\\u00a0\",\n",
       "                \"\\u00a0\\u798f\\u00a0\\u00a0\\u5efa\\u00a0\",\n",
       "                \"\\u00a0\\u5185\\u8499\\u53e4\\u00a0\",\n",
       "                \"\\u00a0\\u6d59\\u00a0\\u00a0\\u6c5f\\u00a0\",\n",
       "                \"\\u00a0\\u5409\\u00a0\\u00a0\\u6797\\u00a0\",\n",
       "                \"\\u00a0\\u9ed1\\u9f99\\u6c5f\\u00a0\",\n",
       "                \"\\u00a0\\u8fbd\\u00a0\\u00a0\\u5b81\\u00a0\",\n",
       "                \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                \"\\u00a0\\u5929\\u00a0\\u00a0\\u6d25\\u00a0\",\n",
       "                \"\\u00a0\\u5317\\u00a0\\u00a0\\u4eac\\u00a0\",\n",
       "                \"\\u00a0\\u4e0a\\u00a0\\u00a0\\u6d77\\u00a0\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u57ce\\u9547\\u4eba\\u53e3\\u6bd4\\u4f8b\\u5bf9\\u6bd4\\u56fe\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"20\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#F7C5D6\"\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_7ae4c62a112b4946bbc96b3e8e8001b0.setOption(option_7ae4c62a112b4946bbc96b3e8e8001b0);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x26c2e2b3760>"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_data = df2['地区'].tolist()\n",
    "y_data = df2['城镇人口比例'].tolist()\n",
    "data_pair = [list(z) for z in zip(x_data, y_data)]\n",
    "data_pair.sort(key=lambda x: x[1])\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(width=\"800px\", height=\"400px\", bg_color=\"#641F37\"))\n",
    "    .add(\n",
    "        series_name=\"城镇人口比例\",\n",
    "        data_pair=data_pair,\n",
    "        rosetype=\"radius\",\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"城镇人口比例对比图\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#F7C5D6\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render_notebook()\n",
    "    \n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 各地区乡村人口比例 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>乡村人口比例</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>上  海</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>北  京</td>\n",
       "      <td>22.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>天  津</td>\n",
       "      <td>28.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广  东</td>\n",
       "      <td>45.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>辽  宁</td>\n",
       "      <td>46.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>黑龙江</td>\n",
       "      <td>48.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>吉  林</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>浙  江</td>\n",
       "      <td>51.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>内蒙古</td>\n",
       "      <td>57.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>福  建</td>\n",
       "      <td>58.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>江  苏</td>\n",
       "      <td>59.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>海  南</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>湖  北</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>山  东</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>山  西</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>青  海</td>\n",
       "      <td>65.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>新  疆</td>\n",
       "      <td>66.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>重  庆</td>\n",
       "      <td>67.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>陕  西</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>宁  夏</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>湖  南</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>安  徽</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>广  西</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>江  西</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>四  川</td>\n",
       "      <td>73.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>河  北</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>甘  肃</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>贵  州</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>河  南</td>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>云  南</td>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>西  藏</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        地区  乡村人口比例\n",
       "0    上  海     12.0\n",
       "1    北  京     22.0\n",
       "2    天  津     28.0\n",
       "3    广  东     45.0\n",
       "4    辽  宁     46.0\n",
       "5     黑龙江     48.0\n",
       "6    吉  林     50.0\n",
       "7    浙  江     51.0\n",
       "8     内蒙古     57.0\n",
       "9    福  建     58.0\n",
       "10   江  苏     59.0\n",
       "11   海  南     60.0\n",
       "12   湖  北     60.0\n",
       "13   山  东     62.0\n",
       "14   山  西     65.0\n",
       "15   青  海     65.0\n",
       "16   新  疆     66.0\n",
       "17   重  庆     67.0\n",
       "18   陕  西     68.0\n",
       "19   宁  夏     68.0\n",
       "20   湖  南     70.0\n",
       "21   安  徽     72.0\n",
       "22   广  西     72.0\n",
       "23   江  西     72.0\n",
       "24   四  川     73.0\n",
       "25   河  北     74.0\n",
       "26   甘  肃     76.0\n",
       "27   贵  州     76.0\n",
       "28   河  南     77.0\n",
       "29   云  南     77.0\n",
       "30   西  藏     81.0"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "population = df2[['地区','乡村人口比例']].groupby('地区').mean().round(0).sort_values(by = '乡村人口比例',ascending = True).reset_index()\n",
    "population"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"82371edda8634868bb9e4431cd69e625\" style=\"width:1000px; height:700px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_82371edda8634868bb9e4431cd69e625 = echarts.init(\n",
       "                    document.getElementById('82371edda8634868bb9e4431cd69e625'), 'white', {renderer: 'canvas'});\n",
       "                var option_82371edda8634868bb9e4431cd69e625 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"funnel\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u4e0a\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                    \"value\": 12.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5317\\u00a0\\u00a0\\u4eac\\u00a0\",\n",
       "                    \"value\": 22.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5929\\u00a0\\u00a0\\u6d25\\u00a0\",\n",
       "                    \"value\": 28.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                    \"value\": 45.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u8fbd\\u00a0\\u00a0\\u5b81\\u00a0\",\n",
       "                    \"value\": 46.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u9ed1\\u9f99\\u6c5f\\u00a0\",\n",
       "                    \"value\": 48.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5409\\u00a0\\u00a0\\u6797\\u00a0\",\n",
       "                    \"value\": 50.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6d59\\u00a0\\u00a0\\u6c5f\\u00a0\",\n",
       "                    \"value\": 51.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5185\\u8499\\u53e4\\u00a0\",\n",
       "                    \"value\": 57.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u798f\\u00a0\\u00a0\\u5efa\\u00a0\",\n",
       "                    \"value\": 58.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u82cf\\u00a0\",\n",
       "                    \"value\": 59.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6d77\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 60.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                    \"value\": 60.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5c71\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                    \"value\": 62.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5c71\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 65.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u9752\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                    \"value\": 65.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u65b0\\u00a0\\u00a0\\u7586\\u00a0\",\n",
       "                    \"value\": 66.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u91cd\\u00a0\\u00a0\\u5e86\\u00a0\",\n",
       "                    \"value\": 67.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u9655\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 68.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5b81\\u00a0\\u00a0\\u590f\\u00a0\",\n",
       "                    \"value\": 68.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 70.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5b89\\u00a0\\u00a0\\u5fbd\\u00a0\",\n",
       "                    \"value\": 72.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 72.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                    \"value\": 72.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u56db\\u00a0\\u00a0\\u5ddd\\u00a0\",\n",
       "                    \"value\": 73.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                    \"value\": 74.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u7518\\u00a0\\u00a0\\u8083\\u00a0\",\n",
       "                    \"value\": 76.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u8d35\\u00a0\\u00a0\\u5dde\\u00a0\",\n",
       "                    \"value\": 76.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 77.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u4e91\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                    \"value\": 77.0\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u00a0\\u897f\\u00a0\\u00a0\\u85cf\\u00a0\",\n",
       "                    \"value\": 81.0\n",
       "                }\n",
       "            ],\n",
       "            \"sort\": \"descending\",\n",
       "            \"gap\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"inside\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": \"{a} <br/>{b} : {c}\",\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"borderColor\": \"#fff\",\n",
       "                \"borderWidth\": 6\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u00a0\\u5c71\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u8d35\\u00a0\\u00a0\\u5dde\\u00a0\",\n",
       "                \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u5c71\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u82cf\\u00a0\",\n",
       "                \"\\u00a0\\u56db\\u00a0\\u00a0\\u5ddd\\u00a0\",\n",
       "                \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u9752\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                \"\\u00a0\\u9ed1\\u9f99\\u6c5f\\u00a0\",\n",
       "                \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                \"\\u00a0\\u5185\\u8499\\u53e4\\u00a0\",\n",
       "                \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u91cd\\u00a0\\u00a0\\u5e86\\u00a0\",\n",
       "                \"\\u00a0\\u897f\\u00a0\\u00a0\\u85cf\\u00a0\",\n",
       "                \"\\u00a0\\u8fbd\\u00a0\\u00a0\\u5b81\\u00a0\",\n",
       "                \"\\u00a0\\u6d77\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u4e91\\u00a0\\u00a0\\u5357\\u00a0\",\n",
       "                \"\\u00a0\\u5409\\u00a0\\u00a0\\u6797\\u00a0\",\n",
       "                \"\\u00a0\\u5317\\u00a0\\u00a0\\u4eac\\u00a0\",\n",
       "                \"\\u00a0\\u798f\\u00a0\\u00a0\\u5efa\\u00a0\",\n",
       "                \"\\u00a0\\u5b89\\u00a0\\u00a0\\u5fbd\\u00a0\",\n",
       "                \"\\u00a0\\u6d59\\u00a0\\u00a0\\u6c5f\\u00a0\",\n",
       "                \"\\u00a0\\u5b81\\u00a0\\u00a0\\u590f\\u00a0\",\n",
       "                \"\\u00a0\\u5929\\u00a0\\u00a0\\u6d25\\u00a0\",\n",
       "                \"\\u00a0\\u9655\\u00a0\\u00a0\\u897f\\u00a0\",\n",
       "                \"\\u00a0\\u65b0\\u00a0\\u00a0\\u7586\\u00a0\",\n",
       "                \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5317\\u00a0\",\n",
       "                \"\\u00a0\\u7518\\u00a0\\u00a0\\u8083\\u00a0\",\n",
       "                \"\\u00a0\\u4e0a\\u00a0\\u00a0\\u6d77\\u00a0\",\n",
       "                \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u4e1c\\u00a0\",\n",
       "                \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5357\\u00a0\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u00a0\\u4e0a\\u00a0\\u00a0\\u6d77\\u00a0\": true,\n",
       "                \"\\u00a0\\u5317\\u00a0\\u00a0\\u4eac\\u00a0\": true,\n",
       "                \"\\u00a0\\u5929\\u00a0\\u00a0\\u6d25\\u00a0\": true,\n",
       "                \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u4e1c\\u00a0\": true,\n",
       "                \"\\u00a0\\u8fbd\\u00a0\\u00a0\\u5b81\\u00a0\": true,\n",
       "                \"\\u00a0\\u9ed1\\u9f99\\u6c5f\\u00a0\": true,\n",
       "                \"\\u00a0\\u5409\\u00a0\\u00a0\\u6797\\u00a0\": true,\n",
       "                \"\\u00a0\\u6d59\\u00a0\\u00a0\\u6c5f\\u00a0\": true,\n",
       "                \"\\u00a0\\u5185\\u8499\\u53e4\\u00a0\": true,\n",
       "                \"\\u00a0\\u798f\\u00a0\\u00a0\\u5efa\\u00a0\": true,\n",
       "                \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u82cf\\u00a0\": true,\n",
       "                \"\\u00a0\\u6d77\\u00a0\\u00a0\\u5357\\u00a0\": true,\n",
       "                \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5317\\u00a0\": true,\n",
       "                \"\\u00a0\\u5c71\\u00a0\\u00a0\\u4e1c\\u00a0\": true,\n",
       "                \"\\u00a0\\u5c71\\u00a0\\u00a0\\u897f\\u00a0\": true,\n",
       "                \"\\u00a0\\u9752\\u00a0\\u00a0\\u6d77\\u00a0\": true,\n",
       "                \"\\u00a0\\u65b0\\u00a0\\u00a0\\u7586\\u00a0\": true,\n",
       "                \"\\u00a0\\u91cd\\u00a0\\u00a0\\u5e86\\u00a0\": true,\n",
       "                \"\\u00a0\\u9655\\u00a0\\u00a0\\u897f\\u00a0\": true,\n",
       "                \"\\u00a0\\u5b81\\u00a0\\u00a0\\u590f\\u00a0\": true,\n",
       "                \"\\u00a0\\u6e56\\u00a0\\u00a0\\u5357\\u00a0\": true,\n",
       "                \"\\u00a0\\u5b89\\u00a0\\u00a0\\u5fbd\\u00a0\": true,\n",
       "                \"\\u00a0\\u5e7f\\u00a0\\u00a0\\u897f\\u00a0\": true,\n",
       "                \"\\u00a0\\u6c5f\\u00a0\\u00a0\\u897f\\u00a0\": true,\n",
       "                \"\\u00a0\\u56db\\u00a0\\u00a0\\u5ddd\\u00a0\": true,\n",
       "                \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5317\\u00a0\": true,\n",
       "                \"\\u00a0\\u7518\\u00a0\\u00a0\\u8083\\u00a0\": true,\n",
       "                \"\\u00a0\\u8d35\\u00a0\\u00a0\\u5dde\\u00a0\": true,\n",
       "                \"\\u00a0\\u6cb3\\u00a0\\u00a0\\u5357\\u00a0\": true,\n",
       "                \"\\u00a0\\u4e91\\u00a0\\u00a0\\u5357\\u00a0\": true,\n",
       "                \"\\u00a0\\u897f\\u00a0\\u00a0\\u85cf\\u00a0\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"subtext\": \"\\u5404\\u5730\\u533a\\u4e61\\u6751\\u4eba\\u53e3\\u6bd4\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_82371edda8634868bb9e4431cd69e625.setOption(option_82371edda8634868bb9e4431cd69e625);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x26c2e28aca0>"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=population['地区']\n",
    "x1=list(x)\n",
    "\n",
    "y=population['乡村人口比例']\n",
    "y1=list(y)\n",
    "\n",
    "data = [[x1[i], y1[i]] for i in range(len(x1))]\n",
    "(\n",
    "    Funnel(init_opts=opts.InitOpts(width=\"1000px\", height=\"700px\"))\n",
    "    .add(\n",
    "        series_name=\"\",\n",
    "        data_pair=data,\n",
    "        gap=2,\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"item\", formatter=\"{a} <br/>{b} : {c}\"),\n",
    "        label_opts=opts.LabelOpts(is_show=True, position=\"inside\"),\n",
    "        itemstyle_opts=opts.ItemStyleOpts(border_color=\"#fff\", border_width=6),\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"\", subtitle=\"各地区乡村人口比例\"))\n",
    "    .render_notebook()\n",
    ")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 主要地区的国内生产总值——柱状图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 导入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>国内生产总值</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京</td>\n",
       "      <td>28014.94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天津</td>\n",
       "      <td>18549.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>石家庄</td>\n",
       "      <td>6460.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>太原</td>\n",
       "      <td>3382.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>呼和浩特</td>\n",
       "      <td>2743.72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>沈阳</td>\n",
       "      <td>5864.97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>大连</td>\n",
       "      <td>7363.92</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>长春</td>\n",
       "      <td>6530.03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>哈尔滨</td>\n",
       "      <td>6355.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>上海</td>\n",
       "      <td>30632.99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>南京</td>\n",
       "      <td>11715.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>杭州</td>\n",
       "      <td>12603.36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>宁波</td>\n",
       "      <td>9842.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>合肥</td>\n",
       "      <td>7213.45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>福州</td>\n",
       "      <td>7103.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>厦门</td>\n",
       "      <td>4351.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>南昌</td>\n",
       "      <td>5003.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>济南</td>\n",
       "      <td>7201.96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>青岛</td>\n",
       "      <td>11037.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>郑州</td>\n",
       "      <td>9130.20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>武汉</td>\n",
       "      <td>13410.34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>长沙</td>\n",
       "      <td>10535.51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>广州</td>\n",
       "      <td>21503.15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>深圳</td>\n",
       "      <td>22490.06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>南宁</td>\n",
       "      <td>4118.83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>海口</td>\n",
       "      <td>1390.58</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>重庆</td>\n",
       "      <td>19424.73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>成都</td>\n",
       "      <td>13889.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>贵阳</td>\n",
       "      <td>3537.96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>昆明</td>\n",
       "      <td>4857.64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>拉萨</td>\n",
       "      <td>479.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>西安</td>\n",
       "      <td>7469.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>兰州</td>\n",
       "      <td>2523.54</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>西宁</td>\n",
       "      <td>1284.91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>银川</td>\n",
       "      <td>1803.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>乌鲁木齐</td>\n",
       "      <td>2743.82</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      地区    国内生产总值\n",
       "0     北京  28014.94\n",
       "1     天津  18549.19\n",
       "2    石家庄   6460.88\n",
       "3     太原   3382.18\n",
       "4   呼和浩特   2743.72\n",
       "5     沈阳   5864.97\n",
       "6     大连   7363.92\n",
       "7     长春   6530.03\n",
       "8    哈尔滨   6355.05\n",
       "9     上海  30632.99\n",
       "10    南京  11715.10\n",
       "11    杭州  12603.36\n",
       "12    宁波   9842.10\n",
       "13    合肥   7213.45\n",
       "14    福州   7103.40\n",
       "15    厦门   4351.70\n",
       "16    南昌   5003.19\n",
       "17    济南   7201.96\n",
       "18    青岛  11037.28\n",
       "19    郑州   9130.20\n",
       "20    武汉  13410.34\n",
       "21    长沙  10535.51\n",
       "22    广州  21503.15\n",
       "23    深圳  22490.06\n",
       "24    南宁   4118.83\n",
       "25    海口   1390.58\n",
       "26    重庆  19424.73\n",
       "27    成都  13889.39\n",
       "28    贵阳   3537.96\n",
       "29    昆明   4857.64\n",
       "30    拉萨    479.25\n",
       "31    西安   7469.85\n",
       "32    兰州   2523.54\n",
       "33    西宁   1284.91\n",
       "34    银川   1803.26\n",
       "35  乌鲁木齐   2743.82"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df3 = pd.read_excel('data3.xlsx', encoding='utf8')\n",
    "df3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"cef00a7aa29949818493ca70e7f82b83\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_cef00a7aa29949818493ca70e7f82b83 = echarts.init(\n",
       "                    document.getElementById('cef00a7aa29949818493ca70e7f82b83'), 'white', {renderer: 'canvas'});\n",
       "                var option_cef00a7aa29949818493ca70e7f82b83 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                30633,\n",
       "                28015,\n",
       "                22490,\n",
       "                21503,\n",
       "                19425,\n",
       "                18549,\n",
       "                13889,\n",
       "                13410,\n",
       "                12603,\n",
       "                11715,\n",
       "                11037,\n",
       "                10536,\n",
       "                9842,\n",
       "                9130,\n",
       "                7470,\n",
       "                7364,\n",
       "                7213,\n",
       "                7202,\n",
       "                7103,\n",
       "                6530,\n",
       "                6461,\n",
       "                6355,\n",
       "                5865,\n",
       "                5003,\n",
       "                4858,\n",
       "                4352,\n",
       "                4119,\n",
       "                3538,\n",
       "                3382,\n",
       "                2744,\n",
       "                2744,\n",
       "                2524,\n",
       "                1803,\n",
       "                1391,\n",
       "                1285,\n",
       "                479\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e0a\\u6d77\",\n",
       "                \"\\u5317\\u4eac\",\n",
       "                \"\\u6df1\\u5733\",\n",
       "                \"\\u5e7f\\u5dde\",\n",
       "                \"\\u91cd\\u5e86\",\n",
       "                \"\\u5929\\u6d25\",\n",
       "                \"\\u6210\\u90fd\",\n",
       "                \"\\u6b66\\u6c49\",\n",
       "                \"\\u676d\\u5dde\",\n",
       "                \"\\u5357\\u4eac\",\n",
       "                \"\\u9752\\u5c9b\",\n",
       "                \"\\u957f\\u6c99\",\n",
       "                \"\\u5b81\\u6ce2\",\n",
       "                \"\\u90d1\\u5dde\",\n",
       "                \"\\u897f\\u5b89\",\n",
       "                \"\\u5927\\u8fde\",\n",
       "                \"\\u5408\\u80a5\",\n",
       "                \"\\u6d4e\\u5357\",\n",
       "                \"\\u798f\\u5dde\",\n",
       "                \"\\u957f\\u6625\",\n",
       "                \"\\u77f3\\u5bb6\\u5e84\",\n",
       "                \"\\u54c8\\u5c14\\u6ee8\",\n",
       "                \"\\u6c88\\u9633\",\n",
       "                \"\\u5357\\u660c\",\n",
       "                \"\\u6606\\u660e\",\n",
       "                \"\\u53a6\\u95e8\",\n",
       "                \"\\u5357\\u5b81\",\n",
       "                \"\\u8d35\\u9633\",\n",
       "                \"\\u592a\\u539f\",\n",
       "                \"\\u4e4c\\u9c81\\u6728\\u9f50\",\n",
       "                \"\\u547c\\u548c\\u6d69\\u7279\",\n",
       "                \"\\u5170\\u5dde\",\n",
       "                \"\\u94f6\\u5ddd\",\n",
       "                \"\\u6d77\\u53e3\",\n",
       "                \"\\u897f\\u5b81\",\n",
       "                \"\\u62c9\\u8428\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4e3b\\u8981\\u5730\\u533a\\u56fd\\u5185\\u751f\\u4ea7\\u603b\\u503c\\u5bf9\\u6bd4\",\n",
       "            \"subtext\": \"\\u4e0a\\u6d77\\u3001\\u5317\\u4eac\\u3001\\u6df1\\u5733\\u7684\\u56fd\\u5185\\u751f\\u4ea7\\u603b\\u503c\\u6700\\u9ad8\\uff0c\\u5e7f\\u5dde\\u7684\\u6570\\u503c\\u4ec5\\u6b21\\u4e8e\\u6df1\\u5733\\uff0c\\u5f88\\u6709\\u53ef\\u80fd\\u4f1a\\u5728\\u51e0\\u5e74\\u540e\\u8d85\\u8fc7\\u6df1\\u5733\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_cef00a7aa29949818493ca70e7f82b83.setOption(option_cef00a7aa29949818493ca70e7f82b83);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x26c2e615f40>"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import charts, options\n",
    "\n",
    "data = pd.read_excel('data3.xlsx')\n",
    "city_chart = charts.Bar(init_opts=options.InitOpts(width='1000px', height='600px'))\n",
    "city_pt = data.pivot_table(index='地区', values='国内生产总值', aggfunc='mean')\n",
    "city_pt = city_pt.sort_values('国内生产总值',\n",
    "                              ascending=False)\n",
    "city_chart.add_xaxis(list(city_pt.index.values))\n",
    "city_chart.add_yaxis('', [round(float(x)) for x in list(city_pt['国内生产总值'])],\n",
    "                     label_opts=options.LabelOpts(is_show=False)).set_global_opts(\n",
    "    datazoom_opts=options.DataZoomOpts(range_start=0, range_end=10, is_show=True))\n",
    "city_chart.set_global_opts(title_opts=options.TitleOpts('主要地区国内生产总值对比',\n",
    "                                                        subtitle='上海、北京、深圳的国内生产总值最高，广州的数值仅次于深圳，很有可能会在几年后超过深圳'))\n",
    "city_chart.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 各省GDP数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 筛选数据（选取五个）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>第2019年</th>\n",
       "      <th>2018年</th>\n",
       "      <th>2017年</th>\n",
       "      <th>2016年</th>\n",
       "      <th>2015年</th>\n",
       "      <th>2014年</th>\n",
       "      <th>2013年</th>\n",
       "      <th>2012年</th>\n",
       "      <th>2011年</th>\n",
       "      <th>2010年</th>\n",
       "      <th>2009年</th>\n",
       "      <th>2008年</th>\n",
       "      <th>2007年</th>\n",
       "      <th>2006年</th>\n",
       "      <th>2005年</th>\n",
       "      <th>2004年</th>\n",
       "      <th>2003年</th>\n",
       "      <th>2002年</th>\n",
       "      <th>2001年</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京市</td>\n",
       "      <td>35445.1</td>\n",
       "      <td>33106.0</td>\n",
       "      <td>29883.0</td>\n",
       "      <td>27041.2</td>\n",
       "      <td>24779.1</td>\n",
       "      <td>22926.0</td>\n",
       "      <td>21134.6</td>\n",
       "      <td>19024.7</td>\n",
       "      <td>17188.8</td>\n",
       "      <td>14964.0</td>\n",
       "      <td>12900.9</td>\n",
       "      <td>11813.1</td>\n",
       "      <td>10425.5</td>\n",
       "      <td>8387.0</td>\n",
       "      <td>7149.8</td>\n",
       "      <td>6252.5</td>\n",
       "      <td>5267.2</td>\n",
       "      <td>4525.7</td>\n",
       "      <td>3861.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天津市</td>\n",
       "      <td>14055.5</td>\n",
       "      <td>13362.9</td>\n",
       "      <td>12450.6</td>\n",
       "      <td>11477.2</td>\n",
       "      <td>10879.5</td>\n",
       "      <td>10640.6</td>\n",
       "      <td>9945.4</td>\n",
       "      <td>9043.0</td>\n",
       "      <td>8112.5</td>\n",
       "      <td>6830.8</td>\n",
       "      <td>5709.6</td>\n",
       "      <td>5182.4</td>\n",
       "      <td>4158.4</td>\n",
       "      <td>3538.2</td>\n",
       "      <td>3158.6</td>\n",
       "      <td>2621.1</td>\n",
       "      <td>2257.8</td>\n",
       "      <td>1926.9</td>\n",
       "      <td>1756.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>河北省</td>\n",
       "      <td>34978.6</td>\n",
       "      <td>32494.6</td>\n",
       "      <td>30640.8</td>\n",
       "      <td>28474.1</td>\n",
       "      <td>26398.4</td>\n",
       "      <td>25208.9</td>\n",
       "      <td>24259.6</td>\n",
       "      <td>23077.5</td>\n",
       "      <td>21384.7</td>\n",
       "      <td>18003.6</td>\n",
       "      <td>15306.9</td>\n",
       "      <td>14200.1</td>\n",
       "      <td>12152.9</td>\n",
       "      <td>10043.0</td>\n",
       "      <td>8773.4</td>\n",
       "      <td>7588.6</td>\n",
       "      <td>6333.6</td>\n",
       "      <td>5518.9</td>\n",
       "      <td>5062.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>山西省</td>\n",
       "      <td>16961.6</td>\n",
       "      <td>15958.1</td>\n",
       "      <td>14484.3</td>\n",
       "      <td>11946.4</td>\n",
       "      <td>11836.4</td>\n",
       "      <td>12094.7</td>\n",
       "      <td>11987.2</td>\n",
       "      <td>11683.1</td>\n",
       "      <td>10894.4</td>\n",
       "      <td>8903.9</td>\n",
       "      <td>7147.6</td>\n",
       "      <td>7223.0</td>\n",
       "      <td>5935.6</td>\n",
       "      <td>4713.6</td>\n",
       "      <td>4079.4</td>\n",
       "      <td>3496.0</td>\n",
       "      <td>2854.3</td>\n",
       "      <td>2324.8</td>\n",
       "      <td>2029.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>内蒙古自治区</td>\n",
       "      <td>17212.5</td>\n",
       "      <td>16140.8</td>\n",
       "      <td>14898.1</td>\n",
       "      <td>13789.3</td>\n",
       "      <td>12949.0</td>\n",
       "      <td>12158.2</td>\n",
       "      <td>11392.4</td>\n",
       "      <td>10470.1</td>\n",
       "      <td>9458.1</td>\n",
       "      <td>8199.9</td>\n",
       "      <td>7104.2</td>\n",
       "      <td>6242.4</td>\n",
       "      <td>5166.9</td>\n",
       "      <td>4161.8</td>\n",
       "      <td>3523.7</td>\n",
       "      <td>2942.4</td>\n",
       "      <td>2388.4</td>\n",
       "      <td>1940.9</td>\n",
       "      <td>1713.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>辽宁省</td>\n",
       "      <td>24855.3</td>\n",
       "      <td>23510.5</td>\n",
       "      <td>21693.0</td>\n",
       "      <td>20392.5</td>\n",
       "      <td>20210.3</td>\n",
       "      <td>20025.7</td>\n",
       "      <td>19208.8</td>\n",
       "      <td>17848.6</td>\n",
       "      <td>16354.9</td>\n",
       "      <td>13896.3</td>\n",
       "      <td>12815.7</td>\n",
       "      <td>12137.7</td>\n",
       "      <td>10292.2</td>\n",
       "      <td>8390.3</td>\n",
       "      <td>7260.8</td>\n",
       "      <td>6469.8</td>\n",
       "      <td>5906.3</td>\n",
       "      <td>5458.2</td>\n",
       "      <td>5033.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>吉林省</td>\n",
       "      <td>11726.8</td>\n",
       "      <td>11253.8</td>\n",
       "      <td>10922.0</td>\n",
       "      <td>10427.0</td>\n",
       "      <td>10018.0</td>\n",
       "      <td>9966.5</td>\n",
       "      <td>9427.9</td>\n",
       "      <td>8678.0</td>\n",
       "      <td>7734.6</td>\n",
       "      <td>6410.5</td>\n",
       "      <td>5434.8</td>\n",
       "      <td>4834.7</td>\n",
       "      <td>4080.3</td>\n",
       "      <td>3226.5</td>\n",
       "      <td>2776.5</td>\n",
       "      <td>2455.2</td>\n",
       "      <td>2141.0</td>\n",
       "      <td>2043.1</td>\n",
       "      <td>1900.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>黑龙江省</td>\n",
       "      <td>13544.4</td>\n",
       "      <td>12846.5</td>\n",
       "      <td>12313.0</td>\n",
       "      <td>11895.0</td>\n",
       "      <td>11690.0</td>\n",
       "      <td>12170.8</td>\n",
       "      <td>11849.1</td>\n",
       "      <td>11015.8</td>\n",
       "      <td>9935.0</td>\n",
       "      <td>8308.3</td>\n",
       "      <td>7218.9</td>\n",
       "      <td>7134.2</td>\n",
       "      <td>6126.3</td>\n",
       "      <td>5329.8</td>\n",
       "      <td>4756.4</td>\n",
       "      <td>4134.7</td>\n",
       "      <td>3609.7</td>\n",
       "      <td>3242.7</td>\n",
       "      <td>3043.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>上海市</td>\n",
       "      <td>37987.6</td>\n",
       "      <td>36011.8</td>\n",
       "      <td>32925.0</td>\n",
       "      <td>29887.0</td>\n",
       "      <td>26887.0</td>\n",
       "      <td>25269.8</td>\n",
       "      <td>23204.1</td>\n",
       "      <td>21305.6</td>\n",
       "      <td>20009.7</td>\n",
       "      <td>17915.4</td>\n",
       "      <td>15742.4</td>\n",
       "      <td>14536.9</td>\n",
       "      <td>12878.7</td>\n",
       "      <td>10598.9</td>\n",
       "      <td>9197.1</td>\n",
       "      <td>8101.6</td>\n",
       "      <td>6804.0</td>\n",
       "      <td>5795.0</td>\n",
       "      <td>5257.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>江苏省</td>\n",
       "      <td>98656.8</td>\n",
       "      <td>93207.6</td>\n",
       "      <td>85869.8</td>\n",
       "      <td>77350.9</td>\n",
       "      <td>71255.9</td>\n",
       "      <td>64830.5</td>\n",
       "      <td>59349.4</td>\n",
       "      <td>53701.9</td>\n",
       "      <td>48839.2</td>\n",
       "      <td>41383.9</td>\n",
       "      <td>34471.7</td>\n",
       "      <td>30945.5</td>\n",
       "      <td>25988.4</td>\n",
       "      <td>21240.8</td>\n",
       "      <td>18121.3</td>\n",
       "      <td>14823.1</td>\n",
       "      <td>12442.9</td>\n",
       "      <td>10606.9</td>\n",
       "      <td>9456.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>浙江省</td>\n",
       "      <td>62462.0</td>\n",
       "      <td>58002.8</td>\n",
       "      <td>52403.1</td>\n",
       "      <td>47254.0</td>\n",
       "      <td>43507.7</td>\n",
       "      <td>40023.5</td>\n",
       "      <td>37334.6</td>\n",
       "      <td>34382.4</td>\n",
       "      <td>31854.8</td>\n",
       "      <td>27399.9</td>\n",
       "      <td>22833.7</td>\n",
       "      <td>21284.6</td>\n",
       "      <td>18640.0</td>\n",
       "      <td>15302.7</td>\n",
       "      <td>13028.3</td>\n",
       "      <td>11482.1</td>\n",
       "      <td>9753.4</td>\n",
       "      <td>8040.7</td>\n",
       "      <td>6927.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>安徽省</td>\n",
       "      <td>36845.5</td>\n",
       "      <td>34010.9</td>\n",
       "      <td>29676.2</td>\n",
       "      <td>26307.7</td>\n",
       "      <td>23831.2</td>\n",
       "      <td>22519.7</td>\n",
       "      <td>20584.0</td>\n",
       "      <td>18341.7</td>\n",
       "      <td>16284.9</td>\n",
       "      <td>13249.8</td>\n",
       "      <td>10864.7</td>\n",
       "      <td>9517.7</td>\n",
       "      <td>7941.6</td>\n",
       "      <td>6500.3</td>\n",
       "      <td>5675.9</td>\n",
       "      <td>5129.1</td>\n",
       "      <td>4307.8</td>\n",
       "      <td>3827.7</td>\n",
       "      <td>3502.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>福建省</td>\n",
       "      <td>42326.6</td>\n",
       "      <td>38687.8</td>\n",
       "      <td>33842.4</td>\n",
       "      <td>29609.4</td>\n",
       "      <td>26819.5</td>\n",
       "      <td>24942.1</td>\n",
       "      <td>22503.8</td>\n",
       "      <td>20190.7</td>\n",
       "      <td>17917.7</td>\n",
       "      <td>15002.5</td>\n",
       "      <td>12418.1</td>\n",
       "      <td>10931.8</td>\n",
       "      <td>9325.6</td>\n",
       "      <td>7468.6</td>\n",
       "      <td>6415.5</td>\n",
       "      <td>5712.1</td>\n",
       "      <td>4999.6</td>\n",
       "      <td>4467.6</td>\n",
       "      <td>4072.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>江西省</td>\n",
       "      <td>24667.3</td>\n",
       "      <td>22716.5</td>\n",
       "      <td>20210.8</td>\n",
       "      <td>18388.6</td>\n",
       "      <td>16780.9</td>\n",
       "      <td>15667.8</td>\n",
       "      <td>14300.2</td>\n",
       "      <td>12807.7</td>\n",
       "      <td>11584.5</td>\n",
       "      <td>9383.2</td>\n",
       "      <td>7630.0</td>\n",
       "      <td>6934.2</td>\n",
       "      <td>5777.6</td>\n",
       "      <td>4696.8</td>\n",
       "      <td>3941.2</td>\n",
       "      <td>3398.1</td>\n",
       "      <td>2812.7</td>\n",
       "      <td>2450.5</td>\n",
       "      <td>2175.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>山东省</td>\n",
       "      <td>70540.5</td>\n",
       "      <td>66648.9</td>\n",
       "      <td>63012.1</td>\n",
       "      <td>58762.5</td>\n",
       "      <td>55288.8</td>\n",
       "      <td>50774.8</td>\n",
       "      <td>47344.3</td>\n",
       "      <td>42957.3</td>\n",
       "      <td>39064.9</td>\n",
       "      <td>33922.5</td>\n",
       "      <td>29540.8</td>\n",
       "      <td>27106.2</td>\n",
       "      <td>22718.1</td>\n",
       "      <td>18967.8</td>\n",
       "      <td>15947.5</td>\n",
       "      <td>13308.1</td>\n",
       "      <td>10903.2</td>\n",
       "      <td>10076.5</td>\n",
       "      <td>9076.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>河南省</td>\n",
       "      <td>53717.8</td>\n",
       "      <td>49935.9</td>\n",
       "      <td>44824.9</td>\n",
       "      <td>40249.3</td>\n",
       "      <td>37084.1</td>\n",
       "      <td>34574.8</td>\n",
       "      <td>31632.5</td>\n",
       "      <td>28961.9</td>\n",
       "      <td>26318.7</td>\n",
       "      <td>22655.0</td>\n",
       "      <td>19181.0</td>\n",
       "      <td>17735.9</td>\n",
       "      <td>14824.5</td>\n",
       "      <td>11977.9</td>\n",
       "      <td>10243.5</td>\n",
       "      <td>8411.2</td>\n",
       "      <td>6942.4</td>\n",
       "      <td>6035.5</td>\n",
       "      <td>5533.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>湖北省</td>\n",
       "      <td>45429.0</td>\n",
       "      <td>42022.0</td>\n",
       "      <td>37235.0</td>\n",
       "      <td>33353.0</td>\n",
       "      <td>30344.0</td>\n",
       "      <td>28242.1</td>\n",
       "      <td>25378.0</td>\n",
       "      <td>22590.9</td>\n",
       "      <td>19942.5</td>\n",
       "      <td>16226.9</td>\n",
       "      <td>13192.1</td>\n",
       "      <td>11497.5</td>\n",
       "      <td>9451.4</td>\n",
       "      <td>7531.8</td>\n",
       "      <td>6469.7</td>\n",
       "      <td>5546.8</td>\n",
       "      <td>4757.5</td>\n",
       "      <td>4212.8</td>\n",
       "      <td>3880.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>湖南省</td>\n",
       "      <td>39894.1</td>\n",
       "      <td>36329.7</td>\n",
       "      <td>33828.1</td>\n",
       "      <td>30853.5</td>\n",
       "      <td>28538.6</td>\n",
       "      <td>25881.3</td>\n",
       "      <td>23545.2</td>\n",
       "      <td>21207.2</td>\n",
       "      <td>18915.0</td>\n",
       "      <td>15574.3</td>\n",
       "      <td>12772.8</td>\n",
       "      <td>11307.4</td>\n",
       "      <td>9285.5</td>\n",
       "      <td>7431.6</td>\n",
       "      <td>6369.9</td>\n",
       "      <td>5542.6</td>\n",
       "      <td>4660.0</td>\n",
       "      <td>4151.5</td>\n",
       "      <td>3831.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>广东省</td>\n",
       "      <td>107986.9</td>\n",
       "      <td>99945.2</td>\n",
       "      <td>91648.7</td>\n",
       "      <td>82163.2</td>\n",
       "      <td>74732.4</td>\n",
       "      <td>68173.0</td>\n",
       "      <td>62503.4</td>\n",
       "      <td>57007.7</td>\n",
       "      <td>53072.8</td>\n",
       "      <td>45944.6</td>\n",
       "      <td>39464.7</td>\n",
       "      <td>36704.2</td>\n",
       "      <td>31742.6</td>\n",
       "      <td>25961.2</td>\n",
       "      <td>21963.0</td>\n",
       "      <td>18658.3</td>\n",
       "      <td>15979.8</td>\n",
       "      <td>13601.9</td>\n",
       "      <td>12126.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>广西壮族自治区</td>\n",
       "      <td>21237.1</td>\n",
       "      <td>19627.8</td>\n",
       "      <td>17790.7</td>\n",
       "      <td>16116.6</td>\n",
       "      <td>14797.8</td>\n",
       "      <td>13587.8</td>\n",
       "      <td>12448.4</td>\n",
       "      <td>11303.6</td>\n",
       "      <td>10299.9</td>\n",
       "      <td>8552.4</td>\n",
       "      <td>7112.9</td>\n",
       "      <td>6455.4</td>\n",
       "      <td>5474.8</td>\n",
       "      <td>4417.8</td>\n",
       "      <td>3742.1</td>\n",
       "      <td>3305.1</td>\n",
       "      <td>2798.2</td>\n",
       "      <td>2523.7</td>\n",
       "      <td>2279.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>海南省</td>\n",
       "      <td>5330.8</td>\n",
       "      <td>4910.7</td>\n",
       "      <td>4497.5</td>\n",
       "      <td>4090.2</td>\n",
       "      <td>3734.2</td>\n",
       "      <td>3449.0</td>\n",
       "      <td>3115.9</td>\n",
       "      <td>2789.4</td>\n",
       "      <td>2463.8</td>\n",
       "      <td>2020.5</td>\n",
       "      <td>1620.3</td>\n",
       "      <td>1474.7</td>\n",
       "      <td>1234.0</td>\n",
       "      <td>1027.5</td>\n",
       "      <td>884.9</td>\n",
       "      <td>802.7</td>\n",
       "      <td>714.0</td>\n",
       "      <td>642.7</td>\n",
       "      <td>579.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>重庆市</td>\n",
       "      <td>23605.8</td>\n",
       "      <td>21588.8</td>\n",
       "      <td>20066.3</td>\n",
       "      <td>18023.0</td>\n",
       "      <td>16040.5</td>\n",
       "      <td>14623.8</td>\n",
       "      <td>13027.6</td>\n",
       "      <td>11595.4</td>\n",
       "      <td>10161.2</td>\n",
       "      <td>8065.3</td>\n",
       "      <td>6651.2</td>\n",
       "      <td>5899.5</td>\n",
       "      <td>4770.7</td>\n",
       "      <td>3900.3</td>\n",
       "      <td>3448.4</td>\n",
       "      <td>3059.5</td>\n",
       "      <td>2615.6</td>\n",
       "      <td>2279.8</td>\n",
       "      <td>2014.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>四川省</td>\n",
       "      <td>46363.8</td>\n",
       "      <td>42902.1</td>\n",
       "      <td>37905.1</td>\n",
       "      <td>33138.5</td>\n",
       "      <td>30342.0</td>\n",
       "      <td>28891.3</td>\n",
       "      <td>26518.0</td>\n",
       "      <td>23922.4</td>\n",
       "      <td>21050.9</td>\n",
       "      <td>17224.8</td>\n",
       "      <td>14190.6</td>\n",
       "      <td>12756.2</td>\n",
       "      <td>10562.1</td>\n",
       "      <td>8494.7</td>\n",
       "      <td>7195.9</td>\n",
       "      <td>6304.0</td>\n",
       "      <td>5346.2</td>\n",
       "      <td>4725.0</td>\n",
       "      <td>4293.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>贵州省</td>\n",
       "      <td>16769.3</td>\n",
       "      <td>15353.2</td>\n",
       "      <td>13605.4</td>\n",
       "      <td>11792.4</td>\n",
       "      <td>10541.0</td>\n",
       "      <td>9173.1</td>\n",
       "      <td>7973.1</td>\n",
       "      <td>6742.2</td>\n",
       "      <td>5615.6</td>\n",
       "      <td>4519.0</td>\n",
       "      <td>3856.7</td>\n",
       "      <td>3504.5</td>\n",
       "      <td>2847.5</td>\n",
       "      <td>2264.1</td>\n",
       "      <td>1939.9</td>\n",
       "      <td>1649.4</td>\n",
       "      <td>1429.0</td>\n",
       "      <td>1243.4</td>\n",
       "      <td>1133.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>云南省</td>\n",
       "      <td>23223.8</td>\n",
       "      <td>20880.6</td>\n",
       "      <td>18486.0</td>\n",
       "      <td>16369.0</td>\n",
       "      <td>14960.0</td>\n",
       "      <td>14041.7</td>\n",
       "      <td>12825.5</td>\n",
       "      <td>11097.4</td>\n",
       "      <td>9523.1</td>\n",
       "      <td>7735.3</td>\n",
       "      <td>6574.4</td>\n",
       "      <td>6016.6</td>\n",
       "      <td>5077.4</td>\n",
       "      <td>4090.7</td>\n",
       "      <td>3497.7</td>\n",
       "      <td>3136.4</td>\n",
       "      <td>2633.4</td>\n",
       "      <td>2358.7</td>\n",
       "      <td>2159.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>西藏自治区</td>\n",
       "      <td>1697.8</td>\n",
       "      <td>1548.4</td>\n",
       "      <td>1349.0</td>\n",
       "      <td>1173.0</td>\n",
       "      <td>1043.0</td>\n",
       "      <td>939.7</td>\n",
       "      <td>828.2</td>\n",
       "      <td>710.2</td>\n",
       "      <td>611.5</td>\n",
       "      <td>512.9</td>\n",
       "      <td>445.7</td>\n",
       "      <td>398.2</td>\n",
       "      <td>344.1</td>\n",
       "      <td>285.9</td>\n",
       "      <td>243.1</td>\n",
       "      <td>217.9</td>\n",
       "      <td>186.0</td>\n",
       "      <td>162.0</td>\n",
       "      <td>139.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>陕西省</td>\n",
       "      <td>25793.2</td>\n",
       "      <td>23941.9</td>\n",
       "      <td>21473.5</td>\n",
       "      <td>19045.8</td>\n",
       "      <td>17898.8</td>\n",
       "      <td>17402.5</td>\n",
       "      <td>15905.4</td>\n",
       "      <td>14142.4</td>\n",
       "      <td>12175.1</td>\n",
       "      <td>9845.2</td>\n",
       "      <td>7997.8</td>\n",
       "      <td>7177.8</td>\n",
       "      <td>5681.8</td>\n",
       "      <td>4595.6</td>\n",
       "      <td>3817.2</td>\n",
       "      <td>3141.6</td>\n",
       "      <td>2587.7</td>\n",
       "      <td>2253.4</td>\n",
       "      <td>2010.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>甘肃省</td>\n",
       "      <td>8718.3</td>\n",
       "      <td>8104.1</td>\n",
       "      <td>7336.7</td>\n",
       "      <td>6907.9</td>\n",
       "      <td>6556.6</td>\n",
       "      <td>6518.4</td>\n",
       "      <td>6014.5</td>\n",
       "      <td>5393.1</td>\n",
       "      <td>4816.9</td>\n",
       "      <td>3943.7</td>\n",
       "      <td>3268.3</td>\n",
       "      <td>3071.7</td>\n",
       "      <td>2675.1</td>\n",
       "      <td>2203.0</td>\n",
       "      <td>1864.6</td>\n",
       "      <td>1653.6</td>\n",
       "      <td>1399.9</td>\n",
       "      <td>1232.0</td>\n",
       "      <td>1125.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>青海省</td>\n",
       "      <td>2941.1</td>\n",
       "      <td>2748.0</td>\n",
       "      <td>2465.1</td>\n",
       "      <td>2258.2</td>\n",
       "      <td>2011.0</td>\n",
       "      <td>1847.7</td>\n",
       "      <td>1713.3</td>\n",
       "      <td>1528.5</td>\n",
       "      <td>1370.4</td>\n",
       "      <td>1144.2</td>\n",
       "      <td>939.7</td>\n",
       "      <td>896.9</td>\n",
       "      <td>720.1</td>\n",
       "      <td>585.2</td>\n",
       "      <td>499.4</td>\n",
       "      <td>443.7</td>\n",
       "      <td>385.0</td>\n",
       "      <td>340.7</td>\n",
       "      <td>300.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>宁夏回族自治区</td>\n",
       "      <td>3748.5</td>\n",
       "      <td>3510.2</td>\n",
       "      <td>3200.3</td>\n",
       "      <td>2781.4</td>\n",
       "      <td>2579.4</td>\n",
       "      <td>2473.9</td>\n",
       "      <td>2327.7</td>\n",
       "      <td>2131.0</td>\n",
       "      <td>1931.8</td>\n",
       "      <td>1571.7</td>\n",
       "      <td>1266.7</td>\n",
       "      <td>1139.2</td>\n",
       "      <td>877.6</td>\n",
       "      <td>683.3</td>\n",
       "      <td>579.9</td>\n",
       "      <td>519.9</td>\n",
       "      <td>442.6</td>\n",
       "      <td>377.2</td>\n",
       "      <td>337.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>新疆维吾尔自治区</td>\n",
       "      <td>13597.1</td>\n",
       "      <td>12809.4</td>\n",
       "      <td>11159.9</td>\n",
       "      <td>9630.8</td>\n",
       "      <td>9306.9</td>\n",
       "      <td>9264.5</td>\n",
       "      <td>8392.6</td>\n",
       "      <td>7411.8</td>\n",
       "      <td>6532.0</td>\n",
       "      <td>5360.2</td>\n",
       "      <td>4237.0</td>\n",
       "      <td>4142.5</td>\n",
       "      <td>3500.0</td>\n",
       "      <td>2957.3</td>\n",
       "      <td>2520.5</td>\n",
       "      <td>2170.4</td>\n",
       "      <td>1889.2</td>\n",
       "      <td>1612.6</td>\n",
       "      <td>1491.6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          地区    第2019年    2018年    2017年    2016年    2015年    2014年    2013年  \\\n",
       "0        北京市   35445.1  33106.0  29883.0  27041.2  24779.1  22926.0  21134.6   \n",
       "1        天津市   14055.5  13362.9  12450.6  11477.2  10879.5  10640.6   9945.4   \n",
       "2        河北省   34978.6  32494.6  30640.8  28474.1  26398.4  25208.9  24259.6   \n",
       "3        山西省   16961.6  15958.1  14484.3  11946.4  11836.4  12094.7  11987.2   \n",
       "4     内蒙古自治区   17212.5  16140.8  14898.1  13789.3  12949.0  12158.2  11392.4   \n",
       "5        辽宁省   24855.3  23510.5  21693.0  20392.5  20210.3  20025.7  19208.8   \n",
       "6        吉林省   11726.8  11253.8  10922.0  10427.0  10018.0   9966.5   9427.9   \n",
       "7       黑龙江省   13544.4  12846.5  12313.0  11895.0  11690.0  12170.8  11849.1   \n",
       "8        上海市   37987.6  36011.8  32925.0  29887.0  26887.0  25269.8  23204.1   \n",
       "9        江苏省   98656.8  93207.6  85869.8  77350.9  71255.9  64830.5  59349.4   \n",
       "10       浙江省   62462.0  58002.8  52403.1  47254.0  43507.7  40023.5  37334.6   \n",
       "11       安徽省   36845.5  34010.9  29676.2  26307.7  23831.2  22519.7  20584.0   \n",
       "12       福建省   42326.6  38687.8  33842.4  29609.4  26819.5  24942.1  22503.8   \n",
       "13       江西省   24667.3  22716.5  20210.8  18388.6  16780.9  15667.8  14300.2   \n",
       "14       山东省   70540.5  66648.9  63012.1  58762.5  55288.8  50774.8  47344.3   \n",
       "15       河南省   53717.8  49935.9  44824.9  40249.3  37084.1  34574.8  31632.5   \n",
       "16       湖北省   45429.0  42022.0  37235.0  33353.0  30344.0  28242.1  25378.0   \n",
       "17       湖南省   39894.1  36329.7  33828.1  30853.5  28538.6  25881.3  23545.2   \n",
       "18       广东省  107986.9  99945.2  91648.7  82163.2  74732.4  68173.0  62503.4   \n",
       "19   广西壮族自治区   21237.1  19627.8  17790.7  16116.6  14797.8  13587.8  12448.4   \n",
       "20       海南省    5330.8   4910.7   4497.5   4090.2   3734.2   3449.0   3115.9   \n",
       "21       重庆市   23605.8  21588.8  20066.3  18023.0  16040.5  14623.8  13027.6   \n",
       "22       四川省   46363.8  42902.1  37905.1  33138.5  30342.0  28891.3  26518.0   \n",
       "23       贵州省   16769.3  15353.2  13605.4  11792.4  10541.0   9173.1   7973.1   \n",
       "24       云南省   23223.8  20880.6  18486.0  16369.0  14960.0  14041.7  12825.5   \n",
       "25     西藏自治区    1697.8   1548.4   1349.0   1173.0   1043.0    939.7    828.2   \n",
       "26       陕西省   25793.2  23941.9  21473.5  19045.8  17898.8  17402.5  15905.4   \n",
       "27       甘肃省    8718.3   8104.1   7336.7   6907.9   6556.6   6518.4   6014.5   \n",
       "28       青海省    2941.1   2748.0   2465.1   2258.2   2011.0   1847.7   1713.3   \n",
       "29   宁夏回族自治区    3748.5   3510.2   3200.3   2781.4   2579.4   2473.9   2327.7   \n",
       "30  新疆维吾尔自治区   13597.1  12809.4  11159.9   9630.8   9306.9   9264.5   8392.6   \n",
       "\n",
       "      2012年    2011年    2010年    2009年    2008年    2007年    2006年    2005年  \\\n",
       "0   19024.7  17188.8  14964.0  12900.9  11813.1  10425.5   8387.0   7149.8   \n",
       "1    9043.0   8112.5   6830.8   5709.6   5182.4   4158.4   3538.2   3158.6   \n",
       "2   23077.5  21384.7  18003.6  15306.9  14200.1  12152.9  10043.0   8773.4   \n",
       "3   11683.1  10894.4   8903.9   7147.6   7223.0   5935.6   4713.6   4079.4   \n",
       "4   10470.1   9458.1   8199.9   7104.2   6242.4   5166.9   4161.8   3523.7   \n",
       "5   17848.6  16354.9  13896.3  12815.7  12137.7  10292.2   8390.3   7260.8   \n",
       "6    8678.0   7734.6   6410.5   5434.8   4834.7   4080.3   3226.5   2776.5   \n",
       "7   11015.8   9935.0   8308.3   7218.9   7134.2   6126.3   5329.8   4756.4   \n",
       "8   21305.6  20009.7  17915.4  15742.4  14536.9  12878.7  10598.9   9197.1   \n",
       "9   53701.9  48839.2  41383.9  34471.7  30945.5  25988.4  21240.8  18121.3   \n",
       "10  34382.4  31854.8  27399.9  22833.7  21284.6  18640.0  15302.7  13028.3   \n",
       "11  18341.7  16284.9  13249.8  10864.7   9517.7   7941.6   6500.3   5675.9   \n",
       "12  20190.7  17917.7  15002.5  12418.1  10931.8   9325.6   7468.6   6415.5   \n",
       "13  12807.7  11584.5   9383.2   7630.0   6934.2   5777.6   4696.8   3941.2   \n",
       "14  42957.3  39064.9  33922.5  29540.8  27106.2  22718.1  18967.8  15947.5   \n",
       "15  28961.9  26318.7  22655.0  19181.0  17735.9  14824.5  11977.9  10243.5   \n",
       "16  22590.9  19942.5  16226.9  13192.1  11497.5   9451.4   7531.8   6469.7   \n",
       "17  21207.2  18915.0  15574.3  12772.8  11307.4   9285.5   7431.6   6369.9   \n",
       "18  57007.7  53072.8  45944.6  39464.7  36704.2  31742.6  25961.2  21963.0   \n",
       "19  11303.6  10299.9   8552.4   7112.9   6455.4   5474.8   4417.8   3742.1   \n",
       "20   2789.4   2463.8   2020.5   1620.3   1474.7   1234.0   1027.5    884.9   \n",
       "21  11595.4  10161.2   8065.3   6651.2   5899.5   4770.7   3900.3   3448.4   \n",
       "22  23922.4  21050.9  17224.8  14190.6  12756.2  10562.1   8494.7   7195.9   \n",
       "23   6742.2   5615.6   4519.0   3856.7   3504.5   2847.5   2264.1   1939.9   \n",
       "24  11097.4   9523.1   7735.3   6574.4   6016.6   5077.4   4090.7   3497.7   \n",
       "25    710.2    611.5    512.9    445.7    398.2    344.1    285.9    243.1   \n",
       "26  14142.4  12175.1   9845.2   7997.8   7177.8   5681.8   4595.6   3817.2   \n",
       "27   5393.1   4816.9   3943.7   3268.3   3071.7   2675.1   2203.0   1864.6   \n",
       "28   1528.5   1370.4   1144.2    939.7    896.9    720.1    585.2    499.4   \n",
       "29   2131.0   1931.8   1571.7   1266.7   1139.2    877.6    683.3    579.9   \n",
       "30   7411.8   6532.0   5360.2   4237.0   4142.5   3500.0   2957.3   2520.5   \n",
       "\n",
       "      2004年    2003年    2002年    2001年  \n",
       "0    6252.5   5267.2   4525.7   3861.5  \n",
       "1    2621.1   2257.8   1926.9   1756.9  \n",
       "2    7588.6   6333.6   5518.9   5062.9  \n",
       "3    3496.0   2854.3   2324.8   2029.5  \n",
       "4    2942.4   2388.4   1940.9   1713.8  \n",
       "5    6469.8   5906.3   5458.2   5033.1  \n",
       "6    2455.2   2141.0   2043.1   1900.9  \n",
       "7    4134.7   3609.7   3242.7   3043.4  \n",
       "8    8101.6   6804.0   5795.0   5257.7  \n",
       "9   14823.1  12442.9  10606.9   9456.8  \n",
       "10  11482.1   9753.4   8040.7   6927.7  \n",
       "11   5129.1   4307.8   3827.7   3502.8  \n",
       "12   5712.1   4999.6   4467.6   4072.9  \n",
       "13   3398.1   2812.7   2450.5   2175.7  \n",
       "14  13308.1  10903.2  10076.5   9076.2  \n",
       "15   8411.2   6942.4   6035.5   5533.0  \n",
       "16   5546.8   4757.5   4212.8   3880.5  \n",
       "17   5542.6   4660.0   4151.5   3831.9  \n",
       "18  18658.3  15979.8  13601.9  12126.6  \n",
       "19   3305.1   2798.2   2523.7   2279.3  \n",
       "20    802.7    714.0    642.7    579.2  \n",
       "21   3059.5   2615.6   2279.8   2014.6  \n",
       "22   6304.0   5346.2   4725.0   4293.5  \n",
       "23   1649.4   1429.0   1243.4   1133.3  \n",
       "24   3136.4   2633.4   2358.7   2159.0  \n",
       "25    217.9    186.0    162.0    139.2  \n",
       "26   3141.6   2587.7   2253.4   2010.6  \n",
       "27   1653.6   1399.9   1232.0   1125.4  \n",
       "28    443.7    385.0    340.7    300.1  \n",
       "29    519.9    442.6    377.2    337.4  \n",
       "30   2170.4   1889.2   1612.6   1491.6  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_excel('2001-2019各省GDP数据.xlsx', encoding='utf8')\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "天津市=data[data['地区'].isin(['天津市'])]\n",
    "天津市GDP=天津市[天津市['第2019年']==天津市['第2019年'].min()]\n",
    "广东省=data[data['地区'].isin(['广东省'])]\n",
    "广东省GDP=广东省[广东省['第2019年']==广东省['第2019年'].min()]\n",
    "\n",
    "上海市=data[data['地区'].isin(['上海市'])]\n",
    "上海市GDP=上海市[上海市['第2019年']==上海市['第2019年'].min()]\n",
    "\n",
    "北京市=data[data['地区'].isin(['北京'])]\n",
    "北京市GDP=北京市[北京市['第2019年']==北京市['第2019年'].min()]\n",
    "\n",
    "四川省=data[data['地区'].isin(['广东省'])]\n",
    "四川省GDP=四川省[四川省['第2019年']==四川省['第2019年'].min()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>地区</th>\n",
       "      <th>第2019年</th>\n",
       "      <th>2018年</th>\n",
       "      <th>2017年</th>\n",
       "      <th>2016年</th>\n",
       "      <th>2015年</th>\n",
       "      <th>2014年</th>\n",
       "      <th>2013年</th>\n",
       "      <th>2012年</th>\n",
       "      <th>2011年</th>\n",
       "      <th>2010年</th>\n",
       "      <th>2009年</th>\n",
       "      <th>2008年</th>\n",
       "      <th>2007年</th>\n",
       "      <th>2006年</th>\n",
       "      <th>2005年</th>\n",
       "      <th>2004年</th>\n",
       "      <th>2003年</th>\n",
       "      <th>2002年</th>\n",
       "      <th>2001年</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>天津市</td>\n",
       "      <td>14055.5</td>\n",
       "      <td>13362.9</td>\n",
       "      <td>12450.6</td>\n",
       "      <td>11477.2</td>\n",
       "      <td>10879.5</td>\n",
       "      <td>10640.6</td>\n",
       "      <td>9945.4</td>\n",
       "      <td>9043.0</td>\n",
       "      <td>8112.5</td>\n",
       "      <td>6830.8</td>\n",
       "      <td>5709.6</td>\n",
       "      <td>5182.4</td>\n",
       "      <td>4158.4</td>\n",
       "      <td>3538.2</td>\n",
       "      <td>3158.6</td>\n",
       "      <td>2621.1</td>\n",
       "      <td>2257.8</td>\n",
       "      <td>1926.9</td>\n",
       "      <td>1756.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>广东省</td>\n",
       "      <td>107986.9</td>\n",
       "      <td>99945.2</td>\n",
       "      <td>91648.7</td>\n",
       "      <td>82163.2</td>\n",
       "      <td>74732.4</td>\n",
       "      <td>68173.0</td>\n",
       "      <td>62503.4</td>\n",
       "      <td>57007.7</td>\n",
       "      <td>53072.8</td>\n",
       "      <td>45944.6</td>\n",
       "      <td>39464.7</td>\n",
       "      <td>36704.2</td>\n",
       "      <td>31742.6</td>\n",
       "      <td>25961.2</td>\n",
       "      <td>21963.0</td>\n",
       "      <td>18658.3</td>\n",
       "      <td>15979.8</td>\n",
       "      <td>13601.9</td>\n",
       "      <td>12126.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>上海市</td>\n",
       "      <td>37987.6</td>\n",
       "      <td>36011.8</td>\n",
       "      <td>32925.0</td>\n",
       "      <td>29887.0</td>\n",
       "      <td>26887.0</td>\n",
       "      <td>25269.8</td>\n",
       "      <td>23204.1</td>\n",
       "      <td>21305.6</td>\n",
       "      <td>20009.7</td>\n",
       "      <td>17915.4</td>\n",
       "      <td>15742.4</td>\n",
       "      <td>14536.9</td>\n",
       "      <td>12878.7</td>\n",
       "      <td>10598.9</td>\n",
       "      <td>9197.1</td>\n",
       "      <td>8101.6</td>\n",
       "      <td>6804.0</td>\n",
       "      <td>5795.0</td>\n",
       "      <td>5257.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>广东省</td>\n",
       "      <td>107986.9</td>\n",
       "      <td>99945.2</td>\n",
       "      <td>91648.7</td>\n",
       "      <td>82163.2</td>\n",
       "      <td>74732.4</td>\n",
       "      <td>68173.0</td>\n",
       "      <td>62503.4</td>\n",
       "      <td>57007.7</td>\n",
       "      <td>53072.8</td>\n",
       "      <td>45944.6</td>\n",
       "      <td>39464.7</td>\n",
       "      <td>36704.2</td>\n",
       "      <td>31742.6</td>\n",
       "      <td>25961.2</td>\n",
       "      <td>21963.0</td>\n",
       "      <td>18658.3</td>\n",
       "      <td>15979.8</td>\n",
       "      <td>13601.9</td>\n",
       "      <td>12126.6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     地区    第2019年    2018年    2017年    2016年    2015年    2014年    2013年  \\\n",
       "1   天津市   14055.5  13362.9  12450.6  11477.2  10879.5  10640.6   9945.4   \n",
       "18  广东省  107986.9  99945.2  91648.7  82163.2  74732.4  68173.0  62503.4   \n",
       "8   上海市   37987.6  36011.8  32925.0  29887.0  26887.0  25269.8  23204.1   \n",
       "18  广东省  107986.9  99945.2  91648.7  82163.2  74732.4  68173.0  62503.4   \n",
       "\n",
       "      2012年    2011年    2010年    2009年    2008年    2007年    2006年    2005年  \\\n",
       "1    9043.0   8112.5   6830.8   5709.6   5182.4   4158.4   3538.2   3158.6   \n",
       "18  57007.7  53072.8  45944.6  39464.7  36704.2  31742.6  25961.2  21963.0   \n",
       "8   21305.6  20009.7  17915.4  15742.4  14536.9  12878.7  10598.9   9197.1   \n",
       "18  57007.7  53072.8  45944.6  39464.7  36704.2  31742.6  25961.2  21963.0   \n",
       "\n",
       "      2004年    2003年    2002年    2001年  \n",
       "1    2621.1   2257.8   1926.9   1756.9  \n",
       "18  18658.3  15979.8  13601.9  12126.6  \n",
       "8    8101.6   6804.0   5795.0   5257.7  \n",
       "18  18658.3  15979.8  13601.9  12126.6  "
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "第2019年=天津市GDP.append([广东省GDP,上海市GDP,北京市GDP,四川省GDP])\n",
    "第2019年"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"11064cab7faa4eb7814a45e85f621086\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_11064cab7faa4eb7814a45e85f621086 = echarts.init(\n",
       "                    document.getElementById('11064cab7faa4eb7814a45e85f621086'), 'white', {renderer: 'canvas'});\n",
       "                var option_11064cab7faa4eb7814a45e85f621086 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5929\\u6d25\\u5e02\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                35445.1,\n",
       "                14055.5,\n",
       "                34978.6,\n",
       "                16961.6,\n",
       "                17212.5,\n",
       "                24855.3,\n",
       "                11726.8,\n",
       "                13544.4,\n",
       "                37987.6,\n",
       "                98656.8,\n",
       "                62462.0,\n",
       "                36845.5,\n",
       "                42326.6,\n",
       "                24667.3,\n",
       "                70540.5,\n",
       "                53717.8,\n",
       "                45429.0,\n",
       "                39894.1,\n",
       "                107986.9,\n",
       "                21237.1,\n",
       "                5330.8,\n",
       "                23605.8,\n",
       "                46363.8,\n",
       "                16769.3,\n",
       "                23223.8,\n",
       "                1697.8,\n",
       "                25793.2,\n",
       "                8718.3,\n",
       "                2941.1,\n",
       "                3748.5,\n",
       "                13597.1\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"color\":         function (params) {            if (params.value < 3000)                 return '#66cc98';            else return '#009999';        }        \n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5929\\u6d25\\u5e02\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u7b2c2019\\u5e74\",\n",
       "                    35445.1\n",
       "                ],\n",
       "                [\n",
       "                    \"2018\\u5e74\",\n",
       "                    14055.5\n",
       "                ],\n",
       "                [\n",
       "                    \"2017\\u5e74\",\n",
       "                    34978.6\n",
       "                ],\n",
       "                [\n",
       "                    \"2016\\u5e74\",\n",
       "                    16961.6\n",
       "                ],\n",
       "                [\n",
       "                    \"2015\\u5e74\",\n",
       "                    17212.5\n",
       "                ],\n",
       "                [\n",
       "                    \"2014\\u5e74\",\n",
       "                    24855.3\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0,\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5929\\u6d25\\u5e02\",\n",
       "                \"\\u5929\\u6d25\\u5e02\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5929\\u6d25\\u5e02\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u7b2c2019\\u5e74\",\n",
       "                \"2018\\u5e74\",\n",
       "                \"2017\\u5e74\",\n",
       "                \"2016\\u5e74\",\n",
       "                \"2015\\u5e74\",\n",
       "                \"2014\\u5e74\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5de5\\u4f5c\\u7ecf\\u9a8c-\\u804c\\u4f4d\\u5206\\u5e03\\u6570\\u91cf\",\n",
       "            \"subtext\": \"\\u4e0d\\u9650\\u5de5\\u4f5c\\u7ecf\\u9a8c\\u7684\\u5c97\\u4f4d\\u6570\\u91cf\\u6bd4\\u8f83\\u591a\\u3002\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_11064cab7faa4eb7814a45e85f621086.setOption(option_11064cab7faa4eb7814a45e85f621086);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x194b12e9fd0>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "#设置颜色\n",
    "color_function = \"\"\"\n",
    "        function (params) {\n",
    "            if (params.value < 3000) \n",
    "                return '#66cc98';\n",
    "            else return '#009999';\n",
    "        }\n",
    "        \"\"\"\n",
    "\n",
    "bar = (\n",
    "        Bar()\n",
    "            .add_xaxis(['第2019年', '2018年', '2017年', '2016年', '2015年', '2014年'])\n",
    "            .add_yaxis(\"天津市\",  y_axis=data['第2019年'].tolist(),itemstyle_opts=opts.ItemStyleOpts(color=JsCode(color_function)))\n",
    "\n",
    "            .set_global_opts(title_opts=opts.TitleOpts(title=\"天津市GDP\",\n",
    "                                                       subtitle='选取天津市GDP数据对比',\n",
    "                                                     ))\n",
    "    )\n",
    "line = (\n",
    "    Line()\n",
    "    .add_xaxis(['第2019年', '2018年', '2017年', '2016年', '2015年', '2014年'])   # x轴\n",
    "    .add_yaxis(\"天津市\",  y_axis=data['第2019年'].tolist(),color=[\"yellow\"])\n",
    "    .set_series_opts(label_opts = opts.LabelOpts(is_show=False))\n",
    "    \n",
    ")\n",
    "\n",
    "bar.overlap(line).render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
